#!/usr/bin/env python

import asyncio
from mcp.client.session import Session
from mcp.client.stdlib.http import HttpMCPTransport


host = 'localhost'

async def main():

    transport = HttpMCPTransport("http://{host}:4000/mcp")  # B IP: host
    # mcp run server.py --transport http --host 0.0.0.0 --port 4000 # run on B

    with await Session(transport) as session:
        await session.initialize()

        result = await session.call_tool(
            "add",
            {"a": 10, "b": 20}
        )

        print(f"Remote MCP result: {result.content[0].text}")


if __name__ == "__main__":
    asyncio.run(main())
